<?php
 //error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
 error_reporting(E_ALL);
 
 //rewrite base URL, default for index = www.domain.com/sire/index
 if ((empty($_REQUEST['__route__'])) || ($_REQUEST['__route__'] == '/') || (!isset($_REQUEST['__route__'])))
 {
	//перевести URL на встроенный веб-сайт, site/index.php
	// главный url игры будет game/index, это те URL, которые роутитятся
	@header('Location: /site/', false, 302);
	exit;
 }
 
 // including core platform
 include_once('inc/agplatform_core.php');
 
 // routing init
 $AGP_Router = AGPlatform_Routing::getInstance();
 
 //start routing
 try 
 {
 	$AGP_Router->dispatchURL($_REQUEST['__route__']);
 }
 catch (AGPlatform_Exception $e)
 {
	if (Zend_Registry::isRegistered('ajax_log'))
	{
		Zend_Registry::get('ajax_log')->log($e, Zend_Log::ERR);
	}
	
	AGPlatform_Core::_Platform_Output_Stop(AGPlatform_Routing::getInstance()->getCurrentParam());
 }
 
